import requests
import datetime

ce = "全部"
hu = '胡宇 18521039810'
zeng = "曾明杰 17621149556"
shi = "时光熠 18337747740"
cui = "崔佳琪 15962914445"
zhao = "赵雷 18221313478"
zhao_sheng_qi = "赵升旗 17680243507"
zhiBan_today = '今日值班人员：'
zhiBan_tomorrow = '，明日值班人员：'

today = datetime.datetime.now().strftime('%Y-%m-%d')
zhiBan_liebiao_main = {'2024-02-04': hu,
                       '2024-02-06': hu,
                       '2024-02-07': hu,
                       '2024-02-08': shi,
                       '2024-02-09': shi,
                       '2024-02-10': shi,
                       '2024-02-11': zhao,
                       '2024-02-12': cui,
                       '2024-02-13': cui,
                       '2024-02-14': hu,
                       '2024-02-15': zhao_sheng_qi,
                       '2024-02-16': zhao_sheng_qi,
                       '2024-02-17': zhao_sheng_qi,
                       '2024-02-18': cui,
                       '2024-02-19': zeng,
                       '2024-02-20': zeng,
                       '2024-02-21': zeng,
                       }
zhiBan_liebiao_bei = {'2024-02-04': hu,
                      '2024-02-06': zeng,
                      '2024-02-07': zeng,
                      '2024-02-08': cui,
                      '2024-02-09': cui,
                      '2024-02-10': cui,
                      '2024-02-11': zhao_sheng_qi,
                      '2024-02-12': zhao_sheng_qi,
                      '2024-02-13': zhao,
                      '2024-02-14': zhao,
                      '2024-02-15': zhao,
                      '2024-02-16': shi,
                      '2024-02-17': shi,
                      '2024-02-18': shi,
                      '2024-02-19': hu,
                      '2024-02-20': hu,
                      '2024-02-21': hu,
                      }
headers = {"Content-Type": "text/plain"}
# send_url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=b86bec6f-facd-4ba8-8f1f-76f28c00cbb9"
send_url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=41305cf7-65fd-44a0-bd07-4b97c32d0c3c"
msg = "# 假期值班提醒\n > 当前日期：<font color=\"info\">" + today + "</font> \n> ### 今日值班：\n <font color=\"warning\">  **- 主**：</font>" + \
      zhiBan_liebiao_main[today] + " \n> <font color=\"info\">  **- 备：**</font>" + zhiBan_liebiao_bei[today]

send_data = {
    "msgtype": "markdown",  # 消息类型，此时固定为markdown
    "markdown": {
        "content": msg  # 字体颜色(只支持3种内置颜色)
    }

}
requests.post(url=send_url, headers=headers, json=send_data)
